<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>跳转界面</title>
</head>
<body>
<div>
    <p><span id = "second">2</span>秒后跳转到主页。。。</p>
</div>
</body>
</html>

<script type="text/javascript">
    window.onload = function(){
        var time = 2;
        var secondEle = document.getElementById("second");
        var timer = setInterval(function(){
            secondEle.innerHTML = time;
            time--;
            if(time==0){
                clearInterval(timer);
                location.href="http://localhost:8080/main";
            }

        },1000);
    }
</script>